package com.example.journeyreserve.network

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

object ServiceCreator {
    private val MIX4_URL = "http://192.168.190.39:8080/"
    private val DEFAULT_URL = "http://192.168.31.233:8080/"
    private val retrofit = Retrofit.Builder()
        .baseUrl(MIX4_URL)
        .addConverterFactory(GsonConverterFactory.create())
        .build()

    fun <T> create(serviceClass: Class<T>): T = retrofit.create(serviceClass)

    inline fun <reified T> create(): T = create(T::class.java)
}

//java.net.ConnectException: Failed to connect to localhost/127.0.0.1:8080